package com.example.nio.controller;

import com.example.nio.commons.Agent;
import com.example.nio.commons.Result;
import com.example.nio.security.config.TokenService;
import com.example.nio.utils.AgentUserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/auth")
public class BaseController {

    @Autowired
    private TokenService tokenService;
    @RequestMapping("/logout")
    public Result getUserList(Authentication authentication){
        String name = authentication.getName();
        Boolean aBoolean = tokenService.loginOut(name);
        return Result.ok(name  +  "退出成功");
    }
}
